package xuegao.study.mall.web.feign;

import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import xuegao.study.mall.common.api.CommonResult;
import xuegao.study.mall.common.model.ums.UmsMemberReceiveAddress;

import java.util.List;

@FeignClient(contextId = "receive", name = "study-rbac-service", path = "/rbac/member/address")
public interface UmsMemberReceiveAddressClient {

    @ApiOperation("添加会员地址")
    @PostMapping("/add")
    CommonResult add(@RequestBody UmsMemberReceiveAddress address);

    @ApiOperation("删除会员地址")
    @PostMapping("/delete/{id}")
    CommonResult delete(@PathVariable Long id);

    @ApiOperation("更新会员地址")
    @PostMapping("/update/{id}")
    CommonResult update(@PathVariable Long id, @RequestBody UmsMemberReceiveAddress address);

    @ApiOperation("会员地址列表")
    @GetMapping("/list")
    CommonResult<List<UmsMemberReceiveAddress>> list(@RequestParam Long memberId);

    @ApiOperation("会员地址详情")
    @GetMapping("/{id}")
    CommonResult<UmsMemberReceiveAddress> getItem(@PathVariable Long id);
}
